// JavaScript Document
function chkImage(obj)
{
	extArray = new Array(".gif", ".jpg", ".png", ".bmp");
	allowSubmit = false;
	file = obj.value;
	while (file.indexOf("\\") != -1) file = file.slice(file.indexOf("\\") + 1);
	ext = file.slice(file.indexOf(".")).toLowerCase();
	for (var i = 0; i < extArray.length; i++)
	{
		if (extArray[i] == ext)
		{
			allowSubmit = true;
			break;
		}
	}
	if (!allowSubmit)
	{
		alert("Invalid file!");
		obj.focus();
		return false;
	}
	return true;
}